﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Krile.Forms.Dialogs.Popup
{
    public partial class GlobalTL : Form
    {
        public GlobalTL()
        {
            InitializeComponent();
            services = new List<Krile.Kernel.Data.Service>();
        }

        List<Krile.Kernel.Data.Service> services;
        private void PublicTL_Load(object sender, EventArgs e)
        {
            foreach (var i in Core.PluginManager.GetServiceEnumerator())
            {
                services.Add(i);
                gtList.Items.Add(i.Name, i.ParentAgent.Status.RecvGlobalTimeline);
            }
        }

        private void gtList_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            services[e.Index].ParentAgent.Status.RecvGlobalTimeline = e.NewValue == CheckState.Checked;
        }
    }
}
